﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>class绑定</title>
		<style>
			.static {
				border: solid 2px black;
			}
			.active {
				width: 100px;
				height: 100px;
				background: green;
			}
			.text-danger {
				background: red;
			}
		</style>
	</head>
	<body>
		<div id = "app">
		   <div v-bind:class="[activeClass, errorClass]"></div>
		</div>
	
		<script src="vue.js"></script>
		<script>
			var vm = new Vue({
		    el: '#app',
		    data: {
		      activeClass: 'active',
	  			errorClass: 'text-danger'
		    }
		  });
		</script>
	</body>
</html>